package jp.com.nobnak.commentviewer.util;

import jp.com.nobnak.commentviewer.R;
import jp.com.nobnak.commentviewer.webview.LoginWebClient;
import android.content.Context;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class WebViewUtil {

	static public void initWebView(final WebView webView, final Context context, 
			UriCommandLauncher launcher) {
	
		
		webView.setWebViewClient(new LoginWebClient(launcher));
        WebSettings settings = webView.getSettings();
        settings.setAppCacheEnabled(true);
        settings.setAppCacheMaxSize(context.getResources().getInteger(
        		R.integer.WEB_APP_CACHE_SIZE));
        settings.setAppCachePath(DirectoryUtil.getWebCacheDir(context).toString());
        settings.setJavaScriptEnabled(true);
        settings.setBuiltInZoomControls(true);
	}

}
